#ifndef DET_H

#define DET_H
#include <string>
#include <algorithm>
#include <opencv2/opencv.hpp>
#include <boost/filesystem.hpp>
#include <boost/exception/all.hpp>
#include <vector>
#include "getter.h"

#define MOUTHS_DETECTED 0
#define NOSES_DETECTED  1
#define EYES_DETECTED   2

using namespace std;
using namespace cv;

typedef boost::error_info<struct tag_my_info,string> my_info;
struct my_error: virtual boost::exception, virtual std::exception { };

typedef vector<Rect> FEATURES;

class Detector
{
public:
	Detector(int argc, char** argv);
	~Detector();
	bool Detect(const Mat & img, double scale, vector<Rect> & result);
	bool DetectFeatures(const Mat & ing, double scale, FEATURES (& res)[3]);
	int Run();

private:
	Detector(Detector const&);
	Detector & operator=(Detector const&);
	bool SaveImage(string const & img_path, Mat const & img);
	string FileParse(string const & param);

private:
	int faces_type;
	CascadeClassifier faces;
	CascadeClassifier eyes;
	CascadeClassifier mouths;
	CascadeClassifier noses;

	string cascade_path;
	string directory_path;
	string cascades_file;
	bool isCascadeLoad;
	size_t work_mode;
	Getter* img_source;
	int img_count_all;
	int obj_count;

};

#endif
